package pe.org.manuela.app

import pe.org.manuela.app.ui.*
import groovy.swing.*
import javax.jnlp.*
import javax.swing.*

public class Main {
	
	static def URL = ServiceManager.lookup("javax.jnlp.BasicService").codeBase.toString()
	
	public static void main(String[] args) {
		def sw = new SwingBuilder()
		sw.lookAndFeel("system")
		sw.edt {
			frame(
				id: "frmMain",
				title: "Sistema",
				size: [800, 600],
				defaultCloseOperation: JFrame.EXIT_ON_CLOSE
			){
				menuBar {
					menu(text: "Administrar", , mnemonic: "A"){
						menuItem(text: "Insumos", mnemonic: "I", actionPerformed: {
							AdministrarInsumos.cargar(sw)
						})
						
						menuItem(text: "Proveedores", mnemonic: "v", actionPerformed: {
						
						})
						
						menuItem(text: "Productos", mnemonic: "p", actionPerformed: {
						
						})
						
						menuItem(text: "Tipos de Producto", mnemonic: "t", actionPerformed: {
						
						})
						
						menuItem(text: "Calidades de Producto", mnemonic: "c", actionPerformed: {
						
						})
						
						menuItem(text: "Tallas de Producto", mnemonic: "l", actionPerformed: {
						
						})
						
						menuItem(text: "Unidades de Medida", mnemonic: "u", actionPerformed: {
						
						})
						separator()
						menuItem(text: "Salir", mnemonic: "s", actionPerformed:{
							System.exit(0)					
						})
					}
					
					menu(text: "Asciaciones", , mnemonic: "S"){
						menuItem(text: "Producto / Insumo", mnemonic: "p", actionPerformed: {
							AsociacionProductoInsumo.cargar(sw)
						})
						
						menuItem(text: "Proveedor / Insumo", mnemonic: "v", actionPerformed: {
							
						})
					}
					
					menu(text: "Ficha Técnica Producto", , mnemonic: "F"){
						menuItem(text: "Ficha Técnica Producto", mnemonic: "f", actionPerformed: {
							
						})
		
					}
					
				}
				desktopPane(id: "escritorio")	
			}
		}
		
		sw.frmMain.visible = true
	}
}
